#ifndef TYPE_API_H
#define TYPE_API_H
namespace _Types
{
#include "Types.h"

  //#define _typeid(n)  (n)
  //#define _TYPENAME(n) _TYPE##n
#define _type(n) _Int_GetType(n)
#define _JOIN_(x,y)  __JOIN__(x,y)
#define __JOIN__(x,y) x##y


#define __FUNCPACKAGING__(_func) \
  template<class X> class _JOIN_(_packaging_,_func){public:const static unsigned long func = ((unsigned long)(_func <X>));}; \
  int* _JOIN_(_JTBL_,_func)[_JOIN_(_support_num_,_func)];
  
  template<template<typename> class X,int to,int now,int support>
    struct _mtypefunc
    {

      constexpr static int** __mtypefunc(int** a)
      {
	
	return ((((support >> (now - to)) & 1)
	     ?(a[now - to] = (int*)(X<_Int_GetType(now)>::func))
		 :0
		 ),_mtypefunc<X,to,now-1,support>::__mtypefunc(a));
		
		}
      };

      template<template<typename>class X,int N,int M>
    struct _mtypefunc<X,N,N,M>  
    { 
  		
      constexpr static int** __mtypefunc(int** a)
      {
	return ((((M) & 1)
	     ?(a[0] = (int*)(X<_Int_GetType(N)>::func))
	     :0
	     ),a);
    
      }
    };

#define DECLARE__MTypeFunc__(funcName,from,to)  const static int _JOIN_(_support_num_,funcName) = to - from;
#define MTypeFunc(funcName,from,to,support)  _Types::_mtypefunc<_JOIN_(_packaging_,funcName),from,to - 1,support>::__mtypefunc(_JOIN_(_JTBL_,funcName))
  
  




}

  static  constexpr int _BINARY_(unsigned long x,int sum,int bit)
  {
    return ( (x > 0) ?
	     _BINARY_(x / 10,sum + ((x % 10) << bit) , bit + 1)
	     :
	     sum
	     );
  }
  
#define _BIN(x)  _BINARY_(x,0,0)

#endif

#include "Types_Api_Stream.h"


